<template>
  <el-container>
    <!--查询条件开始-->
    <el-header height="1">
      <venus-form
        :venus-form-items="venusFormItems.queryFormItems"
        :parms-value="parmsValue.queryParmsValue"
        :form="form.queryForm"
      />
    </el-header>
    <!--查询条件结束-->
    <!--列表开始-->
    <el-main>
      <table-pagination
        :table-data="table.tableData"
        :table-header-config="table.tableHeaderConfig"
        :total="table.total"
        :page-size="table.pageSize"
        :now-page="table.nowPage"
        :operation-config="table.operationConfig"
        @current-change="currentChange"
      />
    </el-main>
    <!--列表结束-->
  </el-container>
</template>

<script>
  import dictionary from '@/dictionary'
  import { formItems } from '@/utils/formItems'
  import Vue from 'vue'

  export default {
    data() {
      return {
        dict: Vue.filter('dict'),
        table: {
          tableData: [],
          tableHeaderConfig: [
            { prop: 'no', label: '序号' },
            { prop: 'date', label: '日期' },
            { prop: 'week', label: '星期' },
            { prop: 'days', label: '间隔天数' },
            { prop: 'issu_ccy', label: '流入资金(万元)' },
            { prop: 'invest_object', label: '流出资金(万元)' },
            { prop: 'risk_lev', label: '缺口资金(万元)' },
            { prop: 'risk_lev', label: '累计资金缺口(万元)' }
          ],
          total: 100,
          pageSize: 10,
          nowPage: 1
        },
        form: {
          // 查询表单
          queryForm: {
            labelWidth: 0,
            button: [
              {
                name: '查询', type: 'success',
                click: () => {
                }
              }
            ]
          },
          // 增删改表单
          modifyForm: {
            labelWidth: 0,
            button: [{
              name: '保存',
              type: 'success',
              click: row => this.addPortFolio(row)
            }]
          }
        },
        formItemdData: {
          // 增删改字段数据源
          modifyFormItemdData: {
            t8_prod_series_name: Object.entries(dictionary.t8_prod_series_name).map(array => ({
              value: array[0],
              label: array[1]
            }))
          }
        },
        parmsValue: {
          // 查询字段值
          queryParmsValue: {
            name: '',
            code: ''
          },
          // 增删改字段值
          modifyParmsValue: {
            name: '',
            code: ''
          }
        },
        venusFormItems: {
          // 查询表单字段
          queryFormItems: [
            formItems.settleDate
          ],
          // 增删改字段
          modifyFormItems: []
        }
      }
    },
    // 生命周期开始
    beforeMount() {

    },
    // 生命周期结束
    methods: {
      currentChange() {

      },
      init() {
        console.info('你触发了第三个tab页，这是个报表来的')
      }
    }
  }
</script>
